package cn.tedu.tmall.front.mall.dao.persist.repository.impl;

import cn.tedu.tmall.front.mall.dao.persist.mapper.OrderMapper;
import cn.tedu.tmall.front.mall.dao.persist.repository.IOrderRepository;
import cn.tedu.tmall.front.mall.pojo.entity.Order;
import cn.tedu.tmall.front.mall.pojo.vo.OrderListItemVO;
import cn.tedu.tmall.front.mall.pojo.vo.OrderStandardVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class OrderRepositoryImpl implements IOrderRepository {
    @Autowired
    private OrderMapper mapper;
    @Override
    public int insert(Order order) {
        return mapper.insert(order);
    }

    @Override
    public OrderStandardVO selectByUserByOrderId(Long orderId, Long userId) {
        OrderStandardVO orderStandardVO = mapper.selectByUserByOrderId(orderId, userId);
        return orderStandardVO;
    }

    @Override
    public List<OrderListItemVO> list(Long userId) {
        List<OrderListItemVO> list = mapper.list(userId);
        return list;
    }
}
